import {
	apiResquest
} from '@/utils/Http.js'
import axios from 'axios';
import qs from 'qs'
// 注册项
export const getRegisterList = params => {
	return apiResquest({
		url: "/api/patientRegister/enabledRegisterConfigList",
		method: "get",
		data: params
	});
};

// 获取验证码
export const getCode = params => {
	return apiResquest({
		url: "/api/msg",
		method: "get",
		data: params
	});
};

// 身份证信息识别
export const poIdCardImgInfo = params => {
	return apiResquest({
		url: "/api/healthCard/scanIdentityCard",
		method: "post",
		data: params
	});
};

// 注册
export const poRegister = params => {
	return apiResquest({
		url: "/api/patient/register",
		method: "post",
		data: params
	});
};

// 更新
export const puRegister = params => {
	return apiResquest({
		url: "/api/patient",
		method: "put",
		data: params
	});
};

// 获取绑定列表
// export const getBindInfo = params => {
//     return apiResquest({
//       url: "/api/patient/bindInfo",
//       method: "post",
//       data: params
//     });
// };


// 获取绑定列表
export const getBindInfo = params => {
	return apiResquest({
		url: "/a/adm/patientCard/select",
		method: "post",
		data: params
	});
};


// 换取Userid
export const getUserId = params => {
	return apiResquest({
		url: "/api/patient/auth",
		method: "get",
		data: params
	});
};

// 切换就诊人
export const changeUser = params => {
	return apiResquest({
		url: "/a/adm/patientCard/changeCard",
		method: "post",
		data: params
	});
};

// 解绑
export const patientCardCancel = params => {
	return apiResquest({
		url: "/a/adm/patientCard/cancel",
		method: "post",
		data: params
	});
};

export const patientCardStatus = params => {
	return apiResquest({
		url: "/a/adm/patientCard/status",
		method: "post",
		data: params
	});
};

// 绑卡
export const userLogin = params => {
	return apiResquest({
		url: "/api/patient/login",
		method: "post",
		data: params
	});
};

// 卡详情
export const userDetail = params => {
	return apiResquest({
		url: "/api/patient/detail",
		method: "get",
		data: params
	});
};

export const weixinCode = params => {
	return apiResquest({
		// url: "/api/patient/weixinCode?code="+params.code,
		url: "/a/adm/patientCard/weChatCode",
		method: "get",
		data: params
	});
};

export const weixinTicket = () => {
	return apiResquest({
		url: "/a/adm/patientCard/getTicket",
		method: "post",
	});
  // return axios.post('https://pdqzyy.hsop.site:18416/bocom/getTicket')
};

export const addPatient = params => {
	return apiResquest({
		// url: "/api/patient/weixinCode?code="+params.code,
		url: "/api/patient/addPatient",
		method: "post",
		data: params
	});
};

export const deletePatient = params => {
	return apiResquest({
		// url: "/api/patient/weixinCode?code="+params.code,
		url: "/api/patient/deletePatient",
		method: "post",
		data: params
	});
};

// -------------------------------------------